The invention relates generally to printer communications and, more particularly, to a method and system for enabling a printing program to communicate with a printer.
Plug and Play is a well-known technology that enables a computer, using the right combination of hardware and software, to configure a newly installed device (such as a printer, modem or a disk drive) with little or no intervention by the user. When a device designed for Plug and Play is installed on a Plug and Play-enabled computer system, the device automatically alerts the computer system to its presence and informs the computer of its communications needs. Based on this communication, the computer""s operating system selects the appropriate driver for the device. The Plug and Play computer system can then allocate the appropriate communications resources to the new device and thereby avoids conflicts with previously installed devices. This technology is designed to make computers more user-friendly to novices who may not understand how to choose interrupt settings, direct-memory access channels, or port assignments.
The MICROSOFT WINDOWS family of operating systems have supported Plug and Play technology since the introduction of the WINDOWS 95 brand operating system. However, the automatic detection of a newly added Plug and Play printer on a computer running the WINDOWS NT brand operating system only occurs when the computer is booting up, or during a user-initiated setup procedure. Thus, a need exists for informing the WINDOWS NT brand operating system of a new printer as soon as it is attached.
Furthermore, the printing program presently used in connection with the WINDOWS NT brand operating system, also known as SPOOLER, is designed to communicate with explicitly-named ports, and requires a static, one-to-one correspondence between a logical port name (a text name, such as xe2x80x9cLPT1xe2x80x9d) and a physical port (such as the parallel port). To facilitate this communication, a port monitor is required to create a data path between the printing program and a kernel-mode device driver. However, port monitors are architecture-specific and thus, for every method of connecting a printer to a computer (e.g. IEEE-1394, PCI, parallel) printer manufacturers have to create a different port monitor. Accordingly, a need exists for allowing the printer, through its device driver, to signal its needs to a generic port monitor, thereby eliminating the need for architecture-specific port monitors.
In accordance with these needs, the present invention is generally realized in a user-mode dynamic port monitor that provides an architecture-independent data path between a printing program and a kernel-mode device driver. The kernel-mode device driver informs a Plug and Play manager of the attributes of the a newly installed printer by registering a printer device object in a designated portion of the operating system registry. The printing program receives notification from the Plug and Play manager whenever there is a change to the list of device objects within the designated portion of the registry and then reacts by making a function call to the dynamic port monitor. In response, the dynamic port monitor uses a conventional xe2x80x9cSetupxe2x80x9d Application Programming Interface (API) to access the registry and obtain this device object. The device object contains the information required by the dynamic port monitor to created a communications path from the printing program to the kernel-mode device driver, and ultimately the printer.